package com.telra.app.server2.util;

import com.telra.app.server.protobuff.OrderProtos;

/**
 * User: jamesarlet
 * Date: 1/16/12
 * Time: 8:55 PM
 */
public class DataMapping {

    public static OrderProtos.OrderTicket.Category getCategory(String category) {
        if (category == null) throw new IllegalArgumentException("String cannot be null") ;

        if (category.equalsIgnoreCase("CLOTHING")) return OrderProtos.OrderTicket.Category.CLOTHING;
        if (category.equalsIgnoreCase("MISC")) return OrderProtos.OrderTicket.Category.MISC;
        if (category.equalsIgnoreCase("ACCESSORIES")) return OrderProtos.OrderTicket.Category.ACCESSORIES;
        if (category.equalsIgnoreCase("FOOTWEAR")) return OrderProtos.OrderTicket.Category.FOOTWEAR;
        if (category.equalsIgnoreCase("OUTERWEAR")) return OrderProtos.OrderTicket.Category.OUTERWEAR;

        throw new IllegalArgumentException("Unknown category = " + category) ;
    }

}
